package com.ruoyi.system.api;

import com.ruoyi.system.api.factory.RemoteQYContactFallbackFactory;
import com.ruoyi.system.api.factory.RemoteWechatFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.List;

/**
 * 微信接口
 *
 * @author ruoyi
 */
@FeignClient(contextId = "remoteWechatService",name = "remoteWechatService",url = "https://api.weixin.qq.com", fallbackFactory = RemoteWechatFallbackFactory.class)
public interface RemoteWechatService
{
    /**
     * 授权登录
     */
    @GetMapping(value = "/sns/jscode2session")
     String formatLogin(@RequestParam("appid")String appid,@RequestParam("secret")String secret,@RequestParam("js_code")String js_code,@RequestParam(value = "grant_type",defaultValue = "authorization_code")String grant_type);


    /**
     * 授权登录
     */
    @GetMapping(value = "/cgi-bin/token")
    String WECHAT_ACCESS_TOKEN_URL(@RequestParam("appid")String appid,@RequestParam("secret")String secret,@RequestParam(value = "grant_type",defaultValue = "authorization_code")String grant_type);

}
